package com.whitedust.top90;

import java.util.Arrays;
import java.util.Comparator;

/**
 *
 * @author A
 * @since 2025/11/16 14:43
 */

public class Top82 {
    public String longestCommonPrefix(String[] strs) {
        String s0 = strs[0];
        for (int i = 0; i < s0.length(); i++) {
            char c = s0.charAt(i);
            for (String s : strs) {
                if (i == s.length() || c != s.charAt(i)) {
                    return s0.substring(0, i);
                }
            }
        }
        return s0;
    }
}
